import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'
const TimeKey = 'time_stamp'
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 获取登录的时间戳
export function getTimeStamp() {
  return Cookies.get(TimeKey)
}
// 设置登录的时间戳
export function setTimeStamp() {
  return Cookies.set(TimeKey, +new Date())
}
// 方法二
// export function setTimeStamp(time) {
// return Cookies.set(TimeKey,time)
// }
